package com.njxxted.activiti.modules.process.extend.service;

import com.njxxted.activiti.common.util.PageUtil;
import com.njxxted.activiti.modules.process.extend.entity.ExtendActCopyEntity;
import com.njxxted.activiti.modules.process.extend.entity.ExtendActInstanceEntity;
import com.njxxted.activiti.modules.process.extend.entity.req.ExtendActInstanceReqEntity;

import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * 描述：工作流扩展表-流程实例表 service
 * <p>
 * 作者：HuTongFu
 * 邮箱：hu_tongfu@163.com
 * 时间：2019-08-10 17:14:48
 */
public interface ExtendActInstanceService {

    ExtendActInstanceEntity queryObject(String id);

    /**
     * 查询我的待办任务
     *
     * @param userId 用户id
     * @return
     */
    PageUtil<ExtendActInstanceEntity> getTaskForMeList(String userId, int pageNum, int pageSize);

    /**
     * 根据条件查询所有已办的任务
     *
     * @param param
     * @return
     */
    PageUtil<ExtendActInstanceEntity> queryMyHasBeenDoneList(ExtendActInstanceReqEntity param);

    /**
     * 查询我发起的
     */
    PageUtil<ExtendActInstanceEntity> getMyStartedList(ExtendActInstanceReqEntity param);

    /**
     * 查询抄送我的
     */
    PageUtil<ExtendActInstanceEntity> getCopy2MeList(ExtendActInstanceReqEntity param);

    /**
     * 更新抄送流程节点状态
     */
    void updCopyStatus(ExtendActCopyEntity param);

    List<ExtendActInstanceEntity> queryListByBean(ExtendActInstanceEntity param);

    /**
     * 保存扩展流程实例（非草稿状态）
     *
     * @param extendActInstanceEntity 参数
     * @return
     */
    int save(ExtendActInstanceEntity extendActInstanceEntity);

    /**
     * 保存扩展流程实例（草稿状态）
     *
     * @param extendActInstanceEntity 参数
     * @return
     */
    int saveDraft(ExtendActInstanceEntity extendActInstanceEntity);

    int update(ExtendActInstanceEntity extendActInstanceEntity);

    int delete(String id);

    int deleteBatch(String[] ids);

    /**
     * 查询流程名称下拉框数据
     *
     * @param param
     * @return
     */
    Set<Map<String, Object>> getSelectData(ExtendActInstanceReqEntity param);

    Map<String, Integer> queryMyHasBeenDoneCount(ExtendActInstanceReqEntity param);

    /**
     * 查询我的草稿流程
     *
     * @param param
     * @return
     */
    PageUtil<ExtendActInstanceEntity> getMyDraftList(ExtendActInstanceReqEntity param);
}
